home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / lang / Python151_Src.lha / Python1.5_Source / Modules / errnomodule.c < prev    next >
C/C++ Source or Header  |  1998-01-25  |  25KB  |  816 lines

  1. /***********************************************************
  2. Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  3. The Netherlands.
  4.  
  5.                         All Rights Reserved
  6.  
  7. Permission to use, copy, modify, and distribute this software and its
  8. documentation for any purpose and without fee is hereby granted,
  9. provided that the above copyright notice appear in all copies and that
  10. both that copyright notice and this permission notice appear in
  11. supporting documentation, and that the names of Stichting Mathematisch
  12. Centrum or CWI or Corporation for National Research Initiatives or
  13. CNRI not be used in advertising or publicity pertaining to
  14. distribution of the software without specific, written prior
  15. permission.
  16.  
  17. While CWI is the initial source for this software, a modified version
  18. is made available by the Corporation for National Research Initiatives
  19. (CNRI) at the Internet address ftp://ftp.python.org.
  20.  
  21. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  22. REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  23. MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  24. CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  25. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  26. PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  27. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  28. PERFORMANCE OF THIS SOFTWARE.
  29.  
  30. ******************************************************************/
  31.  
  32. /* Errno module */
  33.  
  34. #include "Python.h"
  35.  
  36. /* Mac with GUSI has more errors than those in errno.h */
  37. #ifdef USE_GUSI
  38. #include <sys/errno.h>
  39. #endif
  40.  
  41. /* Windows socket errors (WSA*): XXX is this the correct path ???  */
  42. #ifdef MS_WINDOWS
  43. #include <winsock.h>
  44. #endif
  45.  
  46. #include "protos/errnomodule_protos.h"
  47.  
  48. /*
  49.  * Pull in the system error definitions
  50.  */ 
  51.  
  52. static PyMethodDef errno_methods[] = {
  53.     {NULL,              NULL}
  54. };
  55.  
  56. /* Helper function doing the dictionary inserting */
  57.  
  58. static void
  59. _inscode(d, de, name, code)
  60.     PyObject *d;
  61.     PyObject *de;
  62.     char *name;
  63.     int code;
  64. {
  65.     PyObject *u;
  66.     PyObject *v;
  67.  
  68.     u = PyString_FromString(name);
  69.     v = PyInt_FromLong((long) code);
  70.  
  71.     if (!u || !v) {
  72.         /* Don't bother reporting this error */
  73.         PyErr_Clear();
  74.     }
  75.     else {
  76.         /* insert in modules dict */
  77.         PyDict_SetItem(d, u, v);
  78.         /* insert in errorcode dict */
  79.         PyDict_SetItem(de, v, u);
  80.     }
  81.     Py_XDECREF(u);
  82.     Py_XDECREF(v);
  83. }
  84.  
  85. void
  86. initerrno()
  87. {
  88.     PyObject *m, *d, *de;
  89.     m = Py_InitModule("errno", errno_methods);
  90.     d = PyModule_GetDict(m);
  91.     de = PyDict_New();
  92.     if (de == NULL || PyDict_SetItemString(d,"errorcode",de))
  93.         Py_FatalError("can't initialize errno module");
  94.  
  95. /* Macro so I don't have to edit each and every line below... */
  96. #define inscode(d, ds, de, name, code, comment) _inscode(d, de, name, code)
  97.  
  98.     /*
  99.      * The names and comments are borrowed from linux/include/errno.h,
  100.      * which should be pretty all-inclusive
  101.      */ 
  102.  
  103. #ifdef ENODEV
  104.     inscode(d, ds, de, "ENODEV", ENODEV, "No such device");
  105. #endif
  106. #ifdef ENOCSI
  107.     inscode(d, ds, de, "ENOCSI", ENOCSI, "No CSI structure available");
  108. #endif
  109. #ifdef EHOSTUNREACH
  110.     inscode(d, ds, de, "EHOSTUNREACH", EHOSTUNREACH, "No route to host");
  111. #else
  112. #ifdef WSAEHOSTUNREACH
  113.     inscode(d, ds, de, "EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
  114. #endif
  115. #endif
  116. #ifdef ENOMSG
  117.     inscode(d, ds, de, "ENOMSG", ENOMSG, "No message of desired type");
  118. #endif
  119. #ifdef EUCLEAN
  120.     inscode(d, ds, de, "EUCLEAN", EUCLEAN, "Structure needs cleaning");
  121. #endif
  122. #ifdef EL2NSYNC
  123.     inscode(d, ds, de, "EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");
  124. #endif
  125. #ifdef EL2HLT
  126.     inscode(d, ds, de, "EL2HLT", EL2HLT, "Level 2 halted");
  127. #endif
  128. #ifdef ENODATA
  129.     inscode(d, ds, de, "ENODATA", ENODATA, "No data available");
  130. #endif
  131. #ifdef ENOTBLK
  132.     inscode(d, ds, de, "ENOTBLK", ENOTBLK, "Block device required");
  133. #endif
  134. #ifdef ENOSYS
  135.     inscode(d, ds, de, "ENOSYS", ENOSYS, "Function not implemented");
  136. #endif
  137. #ifdef EPIPE
  138.     inscode(d, ds, de, "EPIPE", EPIPE, "Broken pipe");
  139. #endif
  140. #ifdef EINVAL
  141.     inscode(d, ds, de, "EINVAL", EINVAL, "Invalid argument");
  142. #else
  143. #ifdef WSAEINVAL
  144.     inscode(d, ds, de, "EINVAL", WSAEINVAL, "Invalid argument");
  145. #endif
  146. #endif
  147. #ifdef EOVERFLOW
  148.     inscode(d, ds, de, "EOVERFLOW", EOVERFLOW, "Value too large for defined data type");
  149. #endif
  150. #ifdef EADV
  151.     inscode(d, ds, de, "EADV", EADV, "Advertise error");
  152. #endif
  153. #ifdef EINTR
  154.     inscode(d, ds, de, "EINTR", EINTR, "Interrupted system call");
  155. #else
  156. #ifdef WSAEINTR
  157.     inscode(d, ds, de, "EINTR", WSAEINTR, "Interrupted system call");
  158. #endif
  159. #endif
  160. #ifdef EUSERS
  161.     inscode(d, ds, de, "EUSERS", EUSERS, "Too many users");
  162. #else
  163. #ifdef WSAEUSERS
  164.     inscode(d, ds, de, "EUSERS", WSAEUSERS, "Too many users");
  165. #endif
  166. #endif
  167. #ifdef ENOTEMPTY
  168.     inscode(d, ds, de, "ENOTEMPTY", ENOTEMPTY, "Directory not empty");
  169. #else
  170. #ifdef WSAENOTEMPTY
  171.     inscode(d, ds, de, "ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
  172. #endif
  173. #endif
  174. #ifdef ENOBUFS
  175.     inscode(d, ds, de, "ENOBUFS", ENOBUFS, "No buffer space available");
  176. #else
  177. #ifdef WSAENOBUFS
  178.     inscode(d, ds, de, "ENOBUFS", WSAENOBUFS, "No buffer space available");
  179. #endif
  180. #endif
  181. #ifdef EPROTO
  182.     inscode(d, ds, de, "EPROTO", EPROTO, "Protocol error");
  183. #endif
  184. #ifdef EREMOTE
  185.     inscode(d, ds, de, "EREMOTE", EREMOTE, "Object is remote");
  186. #else
  187. #ifdef WSAEREMOTE
  188.     inscode(d, ds, de, "EREMOTE", WSAEREMOTE, "Object is remote");
  189. #endif
  190. #endif
  191. #ifdef ENAVAIL
  192.     inscode(d, ds, de, "ENAVAIL", ENAVAIL, "No XENIX semaphores available");
  193. #endif
  194. #ifdef ECHILD
  195.     inscode(d, ds, de, "ECHILD", ECHILD, "No child processes");
  196. #endif
  197. #ifdef ELOOP
  198.     inscode(d, ds, de, "ELOOP", ELOOP, "Too many symbolic links encountered");
  199. #else
  200. #ifdef WSAELOOP
  201.     inscode(d, ds, de, "ELOOP", WSAELOOP, "Too many symbolic links encountered");
  202. #endif
  203. #endif
  204. #ifdef EXDEV
  205.     inscode(d, ds, de, "EXDEV", EXDEV, "Cross-device link");
  206. #endif
  207. #ifdef E2BIG
  208.     inscode(d, ds, de, "E2BIG", E2BIG, "Arg list too long");
  209. #endif
  210. #ifdef ESRCH
  211.     inscode(d, ds, de, "ESRCH", ESRCH, "No such process");
  212. #endif
  213. #ifdef EMSGSIZE
  214.     inscode(d, ds, de, "EMSGSIZE", EMSGSIZE, "Message too long");
  215. #else
  216. #ifdef WSAEMSGSIZE
  217.     inscode(d, ds, de, "EMSGSIZE", WSAEMSGSIZE, "Message too long");
  218. #endif
  219. #endif
  220. #ifdef EAFNOSUPPORT
  221.     inscode(d, ds, de, "EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");
  222. #else
  223. #ifdef WSAEAFNOSUPPORT
  224.     inscode(d, ds, de, "EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
  225. #endif
  226. #endif
  227. #ifdef EBADR
  228.     inscode(d, ds, de, "EBADR", EBADR, "Invalid request descriptor");
  229. #endif
  230. #ifdef EHOSTDOWN
  231.     inscode(d, ds, de, "EHOSTDOWN", EHOSTDOWN, "Host is down");
  232. #else
  233. #ifdef WSAEHOSTDOWN
  234.     inscode(d, ds, de, "EHOSTDOWN", WSAEHOSTDOWN, "Host is down");
  235. #endif
  236. #endif
  237. #ifdef EPFNOSUPPORT
  238.     inscode(d, ds, de, "EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");
  239. #else
  240. #ifdef WSAEPFNOSUPPORT
  241.     inscode(d, ds, de, "EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
  242. #endif
  243. #endif
  244. #ifdef ENOPROTOOPT
  245.     inscode(d, ds, de, "ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");
  246. #else
  247. #ifdef WSAENOPROTOOPT
  248.     inscode(d, ds, de, "ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
  249. #endif
  250. #endif
  251. #ifdef EBUSY
  252.     inscode(d, ds, de, "EBUSY", EBUSY, "Device or resource busy");
  253. #endif
  254. #ifdef EWOULDBLOCK
  255.     inscode(d, ds, de, "EWOULDBLOCK", EWOULDBLOCK, "Operation would block");
  256. #else
  257. #ifdef WSAEWOULDBLOCK
  258.     inscode(d, ds, de, "EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
  259. #endif
  260. #endif
  261. #ifdef EBADFD
  262.     inscode(d, ds, de, "EBADFD", EBADFD, "File descriptor in bad state");
  263. #endif
  264. #ifdef EDOTDOT
  265.     inscode(d, ds, de, "EDOTDOT", EDOTDOT, "RFS specific error");
  266. #endif
  267. #ifdef EISCONN
  268.     inscode(d, ds, de, "EISCONN", EISCONN, "Transport endpoint is already connected");
  269. #else
  270. #ifdef WSAEISCONN
  271.     inscode(d, ds, de, "EISCONN", WSAEISCONN, "Transport endpoint is already connected");
  272. #endif
  273. #endif
  274. #ifdef ENOANO
  275.     inscode(d, ds, de, "ENOANO", ENOANO, "No anode");
  276. #endif
  277. #ifdef ESHUTDOWN
  278.     inscode(d, ds, de, "ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");
  279. #else
  280. #ifdef WSAESHUTDOWN
  281.     inscode(d, ds, de, "ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
  282. #endif
  283. #endif
  284. #ifdef ECHRNG
  285.     inscode(d, ds, de, "ECHRNG", ECHRNG, "Channel number out of range");
  286. #endif
  287. #ifdef ELIBBAD
  288.     inscode(d, ds, de, "ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");
  289. #endif
  290. #ifdef ENONET
  291.     inscode(d, ds, de, "ENONET", ENONET, "Machine is not on the network");
  292. #endif
  293. #ifdef EBADE
  294.     inscode(d, ds, de, "EBADE", EBADE, "Invalid exchange");
  295. #endif
  296. #ifdef EBADF
  297.     inscode(d, ds, de, "EBADF", EBADF, "Bad file number");
  298. #else
  299. #ifdef WSAEBADF
  300.     inscode(d, ds, de, "EBADF", WSAEBADF, "Bad file number");
  301. #endif
  302. #endif
  303. #ifdef EMULTIHOP
  304.     inscode(d, ds, de, "EMULTIHOP", EMULTIHOP, "Multihop attempted");
  305. #endif
  306. #ifdef EIO
  307.     inscode(d, ds, de, "EIO", EIO, "I/O error");
  308. #endif
  309. #ifdef EUNATCH
  310.     inscode(d, ds, de, "EUNATCH", EUNATCH, "Protocol driver not attached");
  311. #endif
  312. #ifdef EPROTOTYPE
  313.     inscode(d, ds, de, "EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");
  314. #else
  315. #ifdef WSAEPROTOTYPE
  316.     inscode(d, ds, de, "EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
  317. #endif
  318. #endif
  319. #ifdef ENOSPC
  320.     inscode(d, ds, de, "ENOSPC", ENOSPC, "No space left on device");
  321. #endif
  322. #ifdef ENOEXEC
  323.     inscode(d, ds, de, "ENOEXEC", ENOEXEC, "Exec format error");
  324. #endif
  325. #ifdef EALREADY
  326.     inscode(d, ds, de, "EALREADY", EALREADY, "Operation already in progress");
  327. #else
  328. #ifdef WSAEALREADY
  329.     inscode(d, ds, de, "EALREADY", WSAEALREADY, "Operation already in progress");
  330. #endif
  331. #endif
  332. #ifdef ENETDOWN
  333.     inscode(d, ds, de, "ENETDOWN", ENETDOWN, "Network is down");
  334. #else
  335. #ifdef WSAENETDOWN
  336.     inscode(d, ds, de, "ENETDOWN", WSAENETDOWN, "Network is down");
  337. #endif
  338. #endif
  339. #ifdef ENOTNAM
  340.     inscode(d, ds, de, "ENOTNAM", ENOTNAM, "Not a XENIX named type file");
  341. #endif
  342. #ifdef EACCES
  343.     inscode(d, ds, de, "EACCES", EACCES, "Permission denied");
  344. #else
  345. #ifdef WSAEACCES
  346.     inscode(d, ds, de, "EACCES", WSAEACCES, "Permission denied");
  347. #endif
  348. #endif
  349. #ifdef ELNRNG
  350.     inscode(d, ds, de, "ELNRNG", ELNRNG, "Link number out of range");
  351. #endif
  352. #ifdef EILSEQ
  353.     inscode(d, ds, de, "EILSEQ", EILSEQ, "Illegal byte sequence");
  354. #endif
  355. #ifdef ENOTDIR
  356.     inscode(d, ds, de, "ENOTDIR", ENOTDIR, "Not a directory");
  357. #endif
  358. #ifdef ENOTUNIQ
  359.     inscode(d, ds, de, "ENOTUNIQ", ENOTUNIQ, "Name not unique on network");
  360. #endif
  361. #ifdef EPERM
  362.     inscode(d, ds, de, "EPERM", EPERM, "Operation not permitted");
  363. #endif
  364. #ifdef EDOM
  365.     inscode(d, ds, de, "EDOM", EDOM, "Math argument out of domain of func");
  366. #endif
  367. #ifdef EXFULL
  368.     inscode(d, ds, de, "EXFULL", EXFULL, "Exchange full");
  369. #endif
  370. #ifdef ECONNREFUSED
  371.     inscode(d, ds, de, "ECONNREFUSED", ECONNREFUSED, "Connection refused");
  372. #else
  373. #ifdef WSAECONNREFUSED
  374.     inscode(d, ds, de, "ECONNREFUSED", WSAECONNREFUSED, "Connection refused");
  375. #endif
  376. #endif
  377. #ifdef EISDIR
  378.     inscode(d, ds, de, "EISDIR", EISDIR, "Is a directory");
  379. #endif
  380. #ifdef EPROTONOSUPPORT
  381.     inscode(d, ds, de, "EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");
  382. #else
  383. #ifdef WSAEPROTONOSUPPORT
  384.     inscode(d, ds, de, "EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
  385. #endif
  386. #endif
  387. #ifdef EROFS
  388.     inscode(d, ds, de, "EROFS", EROFS, "Read-only file system");
  389. #endif
  390. #ifdef EADDRNOTAVAIL
  391.     inscode(d, ds, de, "EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");
  392. #else
  393. #ifdef WSAEADDRNOTAVAIL
  394.     inscode(d, ds, de, "EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
  395. #endif
  396. #endif
  397. #ifdef EIDRM
  398.     inscode(d, ds, de, "EIDRM", EIDRM, "Identifier removed");
  399. #endif
  400. #ifdef ECOMM
  401.     inscode(d, ds, de, "ECOMM", ECOMM, "Communication error on send");
  402. #endif
  403. #ifdef ESRMNT
  404.     inscode(d, ds, de, "ESRMNT", ESRMNT, "Srmount error");
  405. #endif
  406. #ifdef EREMOTEIO
  407.     inscode(d, ds, de, "EREMOTEIO", EREMOTEIO, "Remote I/O error");
  408. #endif
  409. #ifdef EL3RST
  410.     inscode(d, ds, de, "EL3RST", EL3RST, "Level 3 reset");
  411. #endif
  412. #ifdef EBADMSG
  413.     inscode(d, ds, de, "EBADMSG", EBADMSG, "Not a data message");
  414. #endif
  415. #ifdef ENFILE
  416.     inscode(d, ds, de, "ENFILE", ENFILE, "File table overflow");
  417. #endif
  418. #ifdef ELIBMAX
  419.     inscode(d, ds, de, "ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");
  420. #endif
  421. #ifdef ESPIPE
  422.     inscode(d, ds, de, "ESPIPE", ESPIPE, "Illegal seek");
  423. #endif
  424. #ifdef ENOLINK
  425.     inscode(d, ds, de, "ENOLINK", ENOLINK, "Link has been severed");
  426. #endif
  427. #ifdef ENETRESET
  428.     inscode(d, ds, de, "ENETRESET", ENETRESET, "Network dropped connection because of reset");
  429. #else
  430. #ifdef WSAENETRESET
  431.     inscode(d, ds, de, "ENETRESET", WSAENETRESET, "Network dropped connection because of reset");
  432. #endif
  433. #endif
  434. #ifdef ETIMEDOUT
  435.     inscode(d, ds, de, "ETIMEDOUT", ETIMEDOUT, "Connection timed out");
  436. #else
  437. #ifdef WSAETIMEDOUT
  438.     inscode(d, ds, de, "ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
  439. #endif
  440. #endif
  441. #ifdef ENOENT
  442.     inscode(d, ds, de, "ENOENT", ENOENT, "No such file or directory");
  443. #endif
  444. #ifdef EEXIST
  445.     inscode(d, ds, de, "EEXIST", EEXIST, "File exists");
  446. #endif
  447. #ifdef EDQUOT
  448.     inscode(d, ds, de, "EDQUOT", EDQUOT, "Quota exceeded");
  449. #else
  450. #ifdef WSAEDQUOT
  451.     inscode(d, ds, de, "EDQUOT", WSAEDQUOT, "Quota exceeded");
  452. #endif
  453. #endif
  454. #ifdef ENOSTR
  455.     inscode(d, ds, de, "ENOSTR", ENOSTR, "Device not a stream");
  456. #endif
  457. #ifdef EBADSLT
  458.     inscode(d, ds, de, "EBADSLT", EBADSLT, "Invalid slot");
  459. #endif
  460. #ifdef EBADRQC
  461.     inscode(d, ds, de, "EBADRQC", EBADRQC, "Invalid request code");
  462. #endif
  463. #ifdef ELIBACC
  464.     inscode(d, ds, de, "ELIBACC", ELIBACC, "Can not access a needed shared library");
  465. #endif
  466. #ifdef EFAULT
  467.     inscode(d, ds, de, "EFAULT", EFAULT, "Bad address");
  468. #else
  469. #ifdef WSAEFAULT
  470.     inscode(d, ds, de, "EFAULT", WSAEFAULT, "Bad address");
  471. #endif
  472. #endif
  473. #ifdef EFBIG
  474.     inscode(d, ds, de, "EFBIG", EFBIG, "File too large");
  475. #endif
  476. #ifdef EDEADLK
  477.     inscode(d, ds, de, "EDEADLK", EDEADLK, "Resource deadlock would occur");
  478. #endif
  479. #ifdef ENOTCONN
  480.     inscode(d, ds, de, "ENOTCONN", ENOTCONN, "Transport endpoint is not connected");
  481. #else
  482. #ifdef WSAENOTCONN
  483.     inscode(d, ds, de, "ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
  484. #endif
  485. #endif
  486. #ifdef EDESTADDRREQ
  487.     inscode(d, ds, de, "EDESTADDRREQ", EDESTADDRREQ, "Destination address required");
  488. #else
  489. #ifdef WSAEDESTADDRREQ
  490.     inscode(d, ds, de, "EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
  491. #endif
  492. #endif
  493. #ifdef ELIBSCN
  494.     inscode(d, ds, de, "ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");
  495. #endif
  496. #ifdef ENOLCK
  497.     inscode(d, ds, de, "ENOLCK", ENOLCK, "No record locks available");
  498. #endif
  499. #ifdef EISNAM
  500.     inscode(d, ds, de, "EISNAM", EISNAM, "Is a named type file");
  501. #endif
  502. #ifdef ECONNABORTED
  503.     inscode(d, ds, de, "ECONNABORTED", ECONNABORTED, "Software caused connection abort");
  504. #else
  505. #ifdef WSAECONNABORTED
  506.     inscode(d, ds, de, "ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
  507. #endif
  508. #endif
  509. #ifdef ENETUNREACH
  510.     inscode(d, ds, de, "ENETUNREACH", ENETUNREACH, "Network is unreachable");
  511. #else
  512. #ifdef WSAENETUNREACH
  513.     inscode(d, ds, de, "ENETUNREACH", WSAENETUNREACH, "Network is unreachable");
  514. #endif
  515. #endif
  516. #ifdef ESTALE
  517.     inscode(d, ds, de, "ESTALE", ESTALE, "Stale NFS file handle");
  518. #else
  519. #ifdef WSAESTALE
  520.     inscode(d, ds, de, "ESTALE", WSAESTALE, "Stale NFS file handle");
  521. #endif
  522. #endif
  523. #ifdef ENOSR
  524.     inscode(d, ds, de, "ENOSR", ENOSR, "Out of streams resources");
  525. #endif
  526. #ifdef ENOMEM
  527.     inscode(d, ds, de, "ENOMEM", ENOMEM, "Out of memory");
  528. #endif
  529. #ifdef ENOTSOCK
  530.     inscode(d, ds, de, "ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");
  531. #else
  532. #ifdef WSAENOTSOCK
  533.     inscode(d, ds, de, "ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
  534. #endif
  535. #endif
  536. #ifdef ESTRPIPE
  537.     inscode(d, ds, de, "ESTRPIPE", ESTRPIPE, "Streams pipe error");
  538. #endif
  539. #ifdef EMLINK
  540.     inscode(d, ds, de, "EMLINK", EMLINK, "Too many links");
  541. #endif
  542. #ifdef ERANGE
  543.     inscode(d, ds, de, "ERANGE", ERANGE, "Math result not representable");
  544. #endif
  545. #ifdef ELIBEXEC
  546.     inscode(d, ds, de, "ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");
  547. #endif
  548. #ifdef EL3HLT
  549.     inscode(d, ds, de, "EL3HLT", EL3HLT, "Level 3 halted");
  550. #endif
  551. #ifdef ECONNRESET
  552.     inscode(d, ds, de, "ECONNRESET", ECONNRESET, "Connection reset by peer");
  553. #else
  554. #ifdef WSAECONNRESET
  555.     inscode(d, ds, de, "ECONNRESET", WSAECONNRESET, "Connection reset by peer");
  556. #endif
  557. #endif
  558. #ifdef EADDRINUSE
  559.     inscode(d, ds, de, "EADDRINUSE", EADDRINUSE, "Address already in use");
  560. #else
  561. #ifdef WSAEADDRINUSE
  562.     inscode(d, ds, de, "EADDRINUSE", WSAEADDRINUSE, "Address already in use");
  563. #endif
  564. #endif
  565. #ifdef EOPNOTSUPP
  566.     inscode(d, ds, de, "EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");
  567. #else
  568. #ifdef WSAEOPNOTSUPP
  569.     inscode(d, ds, de, "EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
  570. #endif
  571. #endif
  572. #ifdef EREMCHG
  573.     inscode(d, ds, de, "EREMCHG", EREMCHG, "Remote address changed");
  574. #endif
  575. #ifdef EAGAIN
  576.     inscode(d, ds, de, "EAGAIN", EAGAIN, "Try again");
  577. #endif
  578. #ifdef ENAMETOOLONG
  579.     inscode(d, ds, de, "ENAMETOOLONG", ENAMETOOLONG, "File name too long");
  580. #else
  581. #ifdef WSAENAMETOOLONG
  582.     inscode(d, ds, de, "ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
  583. #endif
  584. #endif
  585. #ifdef ENOTTY
  586.     inscode(d, ds, de, "ENOTTY", ENOTTY, "Not a typewriter");
  587. #endif
  588. #ifdef ERESTART
  589.     inscode(d, ds, de, "ERESTART", ERESTART, "Interrupted system call should be restarted");
  590. #endif
  591. #ifdef ESOCKTNOSUPPORT
  592.     inscode(d, ds, de, "ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");
  593. #else
  594. #ifdef WSAESOCKTNOSUPPORT
  595.     inscode(d, ds, de, "ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
  596. #endif
  597. #endif
  598. #ifdef ETIME
  599.     inscode(d, ds, de, "ETIME", ETIME, "Timer expired");
  600. #endif
  601. #ifdef EBFONT
  602.     inscode(d, ds, de, "EBFONT", EBFONT, "Bad font file format");
  603. #endif
  604. #ifdef EDEADLOCK
  605.     inscode(d, ds, de, "EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");
  606. #endif
  607. #ifdef ETOOMANYREFS
  608.     inscode(d, ds, de, "ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");
  609. #else
  610. #ifdef WSAETOOMANYREFS
  611.     inscode(d, ds, de, "ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
  612. #endif
  613. #endif
  614. #ifdef EMFILE
  615.     inscode(d, ds, de, "EMFILE", EMFILE, "Too many open files");
  616. #else
  617. #ifdef WSAEMFILE
  618.     inscode(d, ds, de, "EMFILE", WSAEMFILE, "Too many open files");
  619. #endif
  620. #endif
  621. #ifdef ETXTBSY
  622.     inscode(d, ds, de, "ETXTBSY", ETXTBSY, "Text file busy");
  623. #endif
  624. #ifdef EINPROGRESS
  625.     inscode(d, ds, de, "EINPROGRESS", EINPROGRESS, "Operation now in progress");
  626. #else
  627. #ifdef WSAEINPROGRESS
  628.     inscode(d, ds, de, "EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
  629. #endif
  630. #endif
  631. #ifdef ENXIO
  632.     inscode(d, ds, de, "ENXIO", ENXIO, "No such device or address");
  633. #endif
  634. #ifdef ENOPKG
  635.     inscode(d, ds, de, "ENOPKG", ENOPKG, "Package not installed");
  636. #endif
  637. #ifdef WSASY
  638.     inscode(d, ds, de, "WSASY", WSASY, "Error WSASY");
  639. #endif
  640. #ifdef WSAEHOSTDOWN
  641.     inscode(d, ds, de, "WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");
  642. #endif
  643. #ifdef WSAENETDOWN
  644.     inscode(d, ds, de, "WSAENETDOWN", WSAENETDOWN, "Network is down");
  645. #endif
  646. #ifdef WSAENOTSOCK
  647.     inscode(d, ds, de, "WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
  648. #endif
  649. #ifdef WSAEHOSTUNREACH
  650.     inscode(d, ds, de, "WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
  651. #endif
  652. #ifdef WSAELOOP
  653.     inscode(d, ds, de, "WSAELOOP", WSAELOOP, "Too many symbolic links encountered");
  654. #endif
  655. #ifdef WSAEMFILE
  656.     inscode(d, ds, de, "WSAEMFILE", WSAEMFILE, "Too many open files");
  657. #endif
  658. #ifdef WSAESTALE
  659.     inscode(d, ds, de, "WSAESTALE", WSAESTALE, "Stale NFS file handle");
  660. #endif
  661. #ifdef WSAVERNOTSUPPORTED
  662.     inscode(d, ds, de, "WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");
  663. #endif
  664. #ifdef WSAENETUNREACH
  665.     inscode(d, ds, de, "WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");
  666. #endif
  667. #ifdef WSAEPROCLIM
  668.     inscode(d, ds, de, "WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");
  669. #endif
  670. #ifdef WSAEFAULT
  671.     inscode(d, ds, de, "WSAEFAULT", WSAEFAULT, "Bad address");
  672. #endif
  673. #ifdef WSANOTINITIALISED
  674.     inscode(d, ds, de, "WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");
  675. #endif
  676. #ifdef WSAEUSERS
  677.     inscode(d, ds, de, "WSAEUSERS", WSAEUSERS, "Too many users");
  678. #endif
  679. #ifdef WSAMAKEASYNCREPL
  680.     inscode(d, ds, de, "WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");
  681. #endif
  682. #ifdef WSAENOPROTOOPT
  683.     inscode(d, ds, de, "WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
  684. #endif
  685. #ifdef WSAECONNABORTED
  686.     inscode(d, ds, de, "WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
  687. #endif
  688. #ifdef WSAENAMETOOLONG
  689.     inscode(d, ds, de, "WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
  690. #endif
  691. #ifdef WSAENOTEMPTY
  692.     inscode(d, ds, de, "WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
  693. #endif
  694. #ifdef WSAESHUTDOWN
  695.     inscode(d, ds, de, "WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
  696. #endif
  697. #ifdef WSAEAFNOSUPPORT
  698.     inscode(d, ds, de, "WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
  699. #endif
  700. #ifdef WSAETOOMANYREFS
  701.     inscode(d, ds, de, "WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
  702. #endif
  703. #ifdef WSAEACCES
  704.     inscode(d, ds, de, "WSAEACCES", WSAEACCES, "Permission denied");
  705. #endif
  706. #ifdef WSATR
  707.     inscode(d, ds, de, "WSATR", WSATR, "Error WSATR");
  708. #endif
  709. #ifdef WSABASEERR
  710.     inscode(d, ds, de, "WSABASEERR", WSABASEERR, "Error WSABASEERR");
  711. #endif
  712. #ifdef WSADESCRIPTIO
  713.     inscode(d, ds, de, "WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");
  714. #endif
  715. #ifdef WSAEMSGSIZE
  716.     inscode(d, ds, de, "WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");
  717. #endif
  718. #ifdef WSAEBADF
  719.     inscode(d, ds, de, "WSAEBADF", WSAEBADF, "Bad file number");
  720. #endif
  721. #ifdef WSAECONNRESET
  722.     inscode(d, ds, de, "WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");
  723. #endif
  724. #ifdef WSAGETSELECTERRO
  725.     inscode(d, ds, de, "WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");
  726. #endif
  727. #ifdef WSAETIMEDOUT
  728.     inscode(d, ds, de, "WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
  729. #endif
  730. #ifdef WSAENOBUFS
  731.     inscode(d, ds, de, "WSAENOBUFS", WSAENOBUFS, "No buffer space available");
  732. #endif
  733. #ifdef WSAEDISCON
  734.     inscode(d, ds, de, "WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");
  735. #endif
  736. #ifdef WSAEINTR
  737.     inscode(d, ds, de, "WSAEINTR", WSAEINTR, "Interrupted system call");
  738. #endif
  739. #ifdef WSAEPROTOTYPE
  740.     inscode(d, ds, de, "WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
  741. #endif
  742. #ifdef WSAHOS
  743.     inscode(d, ds, de, "WSAHOS", WSAHOS, "Error WSAHOS");
  744. #endif
  745. #ifdef WSAEADDRINUSE
  746.     inscode(d, ds, de, "WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");
  747. #endif
  748. #ifdef WSAEADDRNOTAVAIL
  749.     inscode(d, ds, de, "WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
  750. #endif
  751. #ifdef WSAEALREADY
  752.     inscode(d, ds, de, "WSAEALREADY", WSAEALREADY, "Operation already in progress");
  753. #endif
  754. #ifdef WSAEPROTONOSUPPORT
  755.     inscode(d, ds, de, "WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
  756. #endif
  757. #ifdef WSASYSNOTREADY
  758.     inscode(d, ds, de, "WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");
  759. #endif
  760. #ifdef WSAEWOULDBLOCK
  761.     inscode(d, ds, de, "WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
  762. #endif
  763. #ifdef WSAEPFNOSUPPORT
  764.     inscode(d, ds, de, "WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
  765. #endif
  766. #ifdef WSAEOPNOTSUPP
  767.     inscode(d, ds, de, "WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
  768. #endif
  769. #ifdef WSAEISCONN
  770.     inscode(d, ds, de, "WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");
  771. #endif
  772. #ifdef WSAEDQUOT
  773.     inscode(d, ds, de, "WSAEDQUOT", WSAEDQUOT, "Quota exceeded");
  774. #endif
  775. #ifdef WSAENOTCONN
  776.     inscode(d, ds, de, "WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
  777. #endif
  778. #ifdef WSAEREMOTE
  779.     inscode(d, ds, de, "WSAEREMOTE", WSAEREMOTE, "Object is remote");
  780. #endif
  781. #ifdef WSAEINVAL
  782.     inscode(d, ds, de, "WSAEINVAL", WSAEINVAL, "Invalid argument");
  783. #endif
  784. #ifdef WSAEINPROGRESS
  785.     inscode(d, ds, de, "WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
  786. #endif
  787. #ifdef WSAGETSELECTEVEN
  788.     inscode(d, ds, de, "WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");
  789. #endif
  790. #ifdef WSAESOCKTNOSUPPORT
  791.     inscode(d, ds, de, "WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
  792. #endif
  793. #ifdef WSAGETASYNCERRO
  794.     inscode(d, ds, de, "WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");
  795. #endif
  796. #ifdef WSAMAKESELECTREPL
  797.     inscode(d, ds, de, "WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");
  798. #endif
  799. #ifdef WSAGETASYNCBUFLE
  800.     inscode(d, ds, de, "WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");
  801. #endif
  802. #ifdef WSAEDESTADDRREQ
  803.     inscode(d, ds, de, "WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
  804. #endif
  805. #ifdef WSAECONNREFUSED
  806.     inscode(d, ds, de, "WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");
  807. #endif
  808. #ifdef WSAENETRESET
  809.     inscode(d, ds, de, "WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");
  810. #endif
  811. #ifdef WSAN
  812.     inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
  813. #endif
  814.  
  815. }
  816.